<div data-role="page">
<div data-theme="a" data-role="header">
<h1><?php echo $title_for_layout; ?></h1>
<div data-role="navbar" data-iconpos="top">
<?php echo $this -> Form -> create('DateHead', array('data-ajax' => 'false'))?>
<input type=hidden id='hiddenChoosenDate' name='hiddenChoosenDate'></input>
<?php echo $this -> Form -> end();?>

<ul id='reservation'>
	<li>
	<?php
		$timeShow ='本日';
		if ($dateSubmit == date('Y-m-d')) {
			echo $this -> Html -> link($timeShow, '#',
				array('onclick' => "reloadPage('" . date('Y-m-d') . "')", 'data-theme' => '', 'data-icon' => '', 'rel' => 'external', 'class' => 'ui-btn-active ui-state-persist'));
		} else {
			echo $this -> Html -> link($timeShow, '#',
				array('onclick' => "reloadPage('" . date('Y-m-d') . "')", 'data-theme' => '', 'data-icon' => '', 'rel' => 'external'));
		}
	?>
	</li>
	<li>
		<?php
			$today = date('Y-m-d');
			$nextday = strtotime(date("Y-m-d", strtotime($today)) . " +1 day");
			$day = strftime("%d", $nextday);
			$month = strftime("%m", $nextday);
			$timeShow = $month . "月" . $day . "日";
			if ($dateSubmit == date('Y-m-d', $nextday)) {
				echo $this -> Html -> link($timeShow, '#',
					array('onclick' => "reloadPage('" . date('Y-m-d', $nextday) . "')", 'data-theme' => 'c', 'data-icon' => '', 'rel' => 'external', 'class' => 'ui-btn-active ui-state-persist'));
			} else {
				echo $this -> Html -> link($timeShow, '#',
					array('onclick' => "reloadPage('" . date('Y-m-d', $nextday) . "')", 'data-theme' => 'c', 'data-icon' => '', 'rel' => 'external'));
			}
		?> 
	</li>
	<li>
		<?php
			$today = date('Y-m-d');
			$nextday = strtotime(date("Y-m-d", strtotime($today)) . " +2 day");
			$day = strftime("%d", $nextday);
			$month = strftime("%m", $nextday);
			$timeShow = $month . "月" . $day . "日";
			if ($dateSubmit == date('Y-m-d', $nextday)) {
				echo $this -> Html -> link($timeShow, '#',
					array('onclick' => "reloadPage('" . date('Y-m-d', $nextday) . "')", 'data-theme' => 'c', 'data-icon' => '', 'rel' => 'external', 'class' => 'ui-btn-active ui-state-persist'));
			} else {
				echo $this -> Html -> link($timeShow, '#',
					array('onclick' => "reloadPage('" . date('Y-m-d', $nextday) . "')", 'data-theme' => 'c', 'data-icon' => '', 'rel' => 'external'));
			}
		?>
	</li>
</ul>
</div>
<div data-role="navbar" data-iconpos="top">
<ul id='reservation'>
	<li>
		<?php
			$today = date('Y-m-d');
			$nextday = strtotime(date("Y-m-d", strtotime($today)) . " +3 day");
			$day = strftime("%d", $nextday);
			$month = strftime("%m", $nextday);
			$timeShow = $month . "月" .  $day . "日";
			if ($dateSubmit == date('Y-m-d', $nextday)) {
				echo $this -> Html -> link($timeShow, '#',
					array('onclick' => "reloadPage('" . date('Y-m-d', $nextday) . "')", 'data-theme' => 'c', 'data-icon' => '', 'rel' => 'external', 'class' => 'ui-btn-active ui-state-persist'));
			} else {
				echo $this -> Html -> link($timeShow, '#',
					array('onclick' => "reloadPage('" . date('Y-m-d', $nextday) . "')", 'data-theme' => 'c', 'data-icon' => '', 'rel' => 'external'));
			}
		?>
	</li>
	<li>
		<?php
			$today = date('Y-m-d');
			$nextday = strtotime(date("Y-m-d", strtotime($today)) . " +4 day");
			$day = strftime("%d", $nextday);
			$month = strftime("%m", $nextday);
			$timeShow = $month . "月" . $day . "日";
			if ($dateSubmit == date('Y-m-d', $nextday)) {
				echo $this -> Html -> link($timeShow, '#',
					array('onclick' => "reloadPage('" . date('Y-m-d', $nextday) . "')", 'data-theme' => 'c', 'data-icon' => '', 'rel' => 'external', 'class' => 'ui-btn-active ui-state-persist'));
			} else {
				echo $this -> Html -> link($timeShow, '#',
					array('onclick' => "reloadPage('" . date('Y-m-d', $nextday) . "')", 'data-theme' => 'c', 'data-icon' => '', 'rel' => 'external'));
			}
		?>
	</li>
	<li>
		<?php
			$today = date('Y-m-d');
			$nextday = strtotime(date("Y-m-d", strtotime($today)) . " +5 day");
			$day = strftime("%d", $nextday);
			$month = strftime("%m", $nextday);
			$timeShow = $month . "月" . $day . "日";
			if($dateSubmit == date('Y-m-d', $nextday))
			{
				echo $this -> Html -> link($timeShow, '#',
					array('onclick' => "reloadPage('" . date('Y-m-d', $nextday) . "')", 'data-theme' => 'c', 'data-icon' => '', 'rel' => 'external', 'class' => 'ui-btn-active ui-state-persist'));
			}
			else
			{
				echo $this -> Html -> link($timeShow, '#',
					array('onclick' => "reloadPage('" . date('Y-m-d', $nextday) . "')", 'data-theme' => 'c', 'data-icon' => '', 'rel' => 'external'));
			}
		?>
	</li>
	<li>
		<?php
			$today = date('Y-m-d');
			$nextday = strtotime(date("Y-m-d", strtotime($today)) . " +6 day");
			$day = strftime("%d", $nextday);
			$month = strftime("%m", $nextday);
			$timeShow = $month . "月" . $day . "日";
			if ($dateSubmit == date('Y-m-d', $nextday)) {
				echo $this -> Html -> link($timeShow, '#',
					array('onclick' => "reloadPage('" . date('Y-m-d', $nextday) . "')", 'data-theme' => 'c', 'data-icon' => '', 'rel' => 'external', 'class' => 'ui-btn-active ui-state-persist'));
			} else {
				echo $this -> Html -> link($timeShow, '#',
					array('onclick' => "reloadPage('" . date('Y-m-d', $nextday) . "')", 'data-theme' => 'c', 'data-icon' => '', 'rel' => 'external'));
			}
		?>
	</li>
	<li>
		<?php
			$today = date('Y-m-d');
			$nextday = strtotime(date("Y-m-d", strtotime($today)) . " +1 week");
			$day = strftime("%d", $nextday);
			$month=strftime("%m", $nextday);
			$timeShow = $month . "月" .  $day . "日";
			if ($dateSubmit == date('Y-m-d', $nextday)) {
				echo $this -> Html -> link($timeShow, '#',
					array('onclick' => "reloadPage('" . date('Y-m-d', $nextday) . "')", 'data-theme' => 'c', 'data-icon' => '', 'rel' => 'external', 'class' => 'ui-btn-active ui-state-persist'));
			} else {
				echo $this -> Html -> link($timeShow, '#',
					array('onclick' => "reloadPage('" . date('Y-m-d', $nextday) . "')", 'data-theme' => 'c', 'data-icon' => '', 'rel' => 'external'));
			}
		?>
	</li>
</ul>
</div>
</div>
<div data-role="content" style="padding: 15px">
<?php echo $this -> Form -> create('Books', array('url' => array('controller' => 'mobile', 'action'  =>  'updateStatusCustomer'), 'data-ajax' => 'false')); ?>
<div class="ui-grid-a">
<?php $i = 1;?>
<div style="width:100%; height: 100%;">
<table width="100%">
<?php 
	if ($arrResult != array()) {
		foreach ($arrResult as $result):
?>
<tr>
	<td  align="center">
		<p style="text-align: center;"><strong>
<span
	style="color: #3366ff;" data-mce-style="color: #3366ff;">
	<?php 
		echo $result['time'] . "～";
	?>
</span></strong></p>
	</td>
	<td align="center">
	<?php
		switch ($result['status']) {
			case 1:
			case 2:
				echo "<span class='reservation_cal_span_status2' number=" . $i . " time=" . $result['time'] . "></span>";
				break;
			case 0:
			case 3:
			case 4:
			case 5:
			case 6:
				echo "<span class='reservation_cal_span' number=" . $i . " time=" . $result['time'] . "></span>";
				break;
			default:
				break;
		}
		$i++;
	?>
	</td>
</tr>
<?php endforeach;} else {
	echo "<div class='messageNoneWork'>休診日です。</div>";
}?>
</table>
</div>
<input type=hidden id='reservation_cal_hidden_value_dateBook' name='hiddenValueDateBook' value="<?php echo $dateSubmit?>"></input>
<input type=hidden id='reservation_cal_hidden_value_timeBook' name='hiddenValueTimeBook'></input>
<input type=hidden id='reservation_cal_hidden_value_numberBook' name='hiddenValueNumberBook'></input>
<?php
	if ($lock == 1) {
		echo "<input type=hidden id='reservation_cal_hidden_choice' value='lock'></input>";
	} else if($lock == 2) {
		echo "<input type=hidden id='reservation_cal_hidden_choice' value='lockToday'></input>";
	} else {
		echo "<input type=hidden id='reservation_cal_hidden_choice' value='unlock'></input>";
	}
	echo $this -> Html -> link('自分の予約を確認する', array('controller' => 'mobile', 'action' => 'checkValueCustomerInBook'),
			array('data-role' => 'button', 'data-transition' => 'fade', 'data-theme' => 'b', 'rel' => 'external'));
?>
</div>
<div data-role="tabbar" data-iconpos="top" data-theme="b">
<ul>
	<li>
		<?php
			echo $this -> Html -> link('　Home　', array('controller' => 'mobile', 'action' => 'index'), array('data-them' => '', 'data-icon' => 'home', 'rel' => 'external'));
		?>
	</li>
	<li>
		<?php
			echo $this -> Html -> link('予約する', array('controller' => 'mobile', 'action' => 'reserve'), array('class' => 'mobile_active_button', 'data-them' => '', 'data-icon' => 'star', 'rel' => 'external'));
		?>
	</li>
	<li>
		<?php
			echo $this -> Html -> link('只今の順番確認', array('controller' => 'mobile', 'action' => 'confirm_book'), array('data-them' => '', 'data-icon' => 'info', 'rel' => 'external'));
		?>
	</li>
</ul>
</div>
</div>
</div>
<div id="popupReservation" class="popupReservation">
	<p>この日時で予約する。</p>
	<input type="button" class="mobile_popup_btn_yes" id="btnSave" name="btnSave">
	<input type="button" id="btnCancel" onclick="cancelSubmitForm()" class="mobile_popup_btn_no" name="btnCancel">
</div>
<div id="popupReservation_bg" class="popupReservation_bg">
</div>

<div id="popupReservationLock" class="popupReservation">
	<p id="mesageLock"></p>
	<input type="button" id="btnCancel" onclick="cancelSubmitFormLock()" class="mobile_popup_btn_ok" name="btnCancel">
</div>
<div id="popupReservationLock_bg" class="popupReservation_bg">
</div>
